home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pbaseiv.zip / P4SPR004.TIP < prev    next >
Text File  |  1991-12-16  |  2KB  |  56 lines

  1. When you need to repeat a few keystrokes in 1-2-3 but won't
  2. need to repeat them in the future, writing a full macro may
  3. be more trouble than it's worth. To simplify the job of
  4. creating throwaway commands, I wrote a macro that records
  5. keystrokes and plays them back a specified number of times.
  6.  
  7. A ready-to-use copy of the macro [shown below] is in the
  8. file P4SPREAD\RECORDER.WK1 on your PowerBase *.* Volume IV
  9. diskette. Note that \R and \P are range names.
  10.  
  11. To see how the macro works, move to a blank cell and press
  12. <Alt>-R to begin recording. Type the keystrokes you want to
  13. repeat, then press <F10> to stop recording. Move to another
  14. cell, and press <Alt>-P. Enter the number of repetitions,
  15. and press <Enter>. The macro will then type your keystrokes
  16. as many times as you've specified.
  17.  
  18. William O. Johnson
  19. Racine, Wisconsin
  20.  
  21. Editor's note: The macro is limited to 480 characters, but
  22. the number of keys it can store may be less, as some keys
  23. take more than one character. For example, <Cursor Down> is
  24. represented as {DOWN}. But if you need to increase the
  25. recorder's memory capacity, it's not hard to do. Simply add
  26. more strings (str3, str4, etc.) to hold the additional data,
  27. and replace the simple test in AB9 with code that calculates
  28. the label of the cell being filled from the counter value.
  29.  
  30.  
  31.         AA       AB       AC       AD       AE       AF
  32. 1   \R       {let str1,""}{let str2,""}{let counter,0}{store}
  33. 2
  34. 3   str1
  35. 4   str2
  36. 5
  37. 6   store    {get char}
  38. 7            {if char="{graph}"}{return}
  39. 8            {let counter,counter+@length(char)}
  40. 9            {if counter>240}{branch fillstr2}
  41. 10           {let str1,+str1&char}{branch char}
  42. 11  fillstr2 {let str2,+str2&char}
  43. 12  char
  44. 13           {branch store}
  45. 14
  46. 15  repeat
  47. 16  counter
  48. 17  \P       {getnumber "How many repetitions? ",repeat}
  49. 18           {for counter,1,repeat,1,str1}
  50.  
  51. Title: Repeat Business
  52. Category: SPR
  53. Issue date: May 1991
  54. Editor: Tom Swan
  55. Supplementary files: P4SPREAD\RECORDER.WK1
  56.